# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=retroarch
# If you plan to upgrade RetroArch, you also need to upgrade the following
# packages at the same time:
# - libretro-database
# - libretro-core-info
# - retroarch-assets
# - retroarch-joypad-autoconfig
pkgver=1.15.0
pkgrel=3
arch="all"
url="https://retroarch.com"
pkgdesc="Reference frontend for the libretro API"
license="GPL-2.0-only"
depends="retroarch-assets retroarch-joypad-autoconfig libretro-core-info libretro-database"
makedepends="linux-headers mesa-dev qt5-qtbase-dev wayland-dev wayland-protocols
	zlib-dev alsa-lib-dev pulseaudio-dev sdl2-dev flac-dev mbedtls-dev libusb-dev
	openssl-dev>3 ffmpeg-dev libxkbcommon-dev eudev-dev vulkan-loader-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/libretro/retroarch/archive/v$pkgver.tar.gz
	config.patch
	"
subpackages="$pkgname-doc"
builddir="$srcdir/RetroArch-$pkgver"
options="!check" # No tests

build() {
	CFLAGS="$CFLAGS -I/usr/include/directfb"
	./configure \
		--prefix=/usr \
		--disable-builtinflac \
		--disable-builtinmbedtls \
		--disable-builtinzlib \
		--disable-discord \
		--disable-vg \
		--disable-videocore \
		--enable-bluetooth \
		--enable-dynamic \
		--enable-egl \
		--enable-kms \
		--enable-wifi
	make
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="
8981bfa58a4b44befad8dd00a160c2e00ac4a023567f9c31a45707f687afa51c50ac42120685d25039ff305d31e06f9e3e40d47ba7f1800885c2619182b6ab5a  retroarch-1.15.0.tar.gz
0b3a8e1fe318d783a5a34606da187d086f8ad9b543cc496c9c6d527dca40d0078a66a6ccb11b1aaf3519a37ac93c8790af0d916c628ae9286066c0a84308fa15  config.patch
"
